package 面向对象.day06;

import javax.swing.*;

/**
 * @author 王敬仟
 * Iamges图片类
 */
public class Iamges {
    public static ImageIcon battleship;//战舰
    public static ImageIcon bomb;//炸弹
    public static ImageIcon mine;//水雷
    public static ImageIcon minesubm;//鱼雷潜艇
    public static ImageIcon obsersubm;//侦查潜艇
    public static ImageIcon torpesubm;//水雷潜艇
    public static ImageIcon gameover;//结束游戏
    public static ImageIcon sea;//海洋
    /*赋值*/
    static {
        //访问上级目录中的图片用目录名/图片名.图片格式
        battleship=new ImageIcon("img/battleship.png");
        bomb=new ImageIcon("img/bomb.png");
        mine=new ImageIcon("img/mine.png");
        minesubm=new ImageIcon("img/minesubm.png");
        obsersubm=new ImageIcon("img/obsersubm.png");
        torpesubm=new ImageIcon("img/torpesubm.png");
        gameover=new ImageIcon("img/gameover.png");
        sea=new ImageIcon("img/sea.png");
    }
    /*测试图片路径是否找到*/
    public static void main(String[] args) {
        //显示8说明访问图片路劲成功
        System.out.println(battleship.getImageLoadStatus());
        System.out.println(bomb.getImageLoadStatus());
        System.out.println(mine.getImageLoadStatus());
        System.out.println(minesubm.getImageLoadStatus());
        System.out.println(obsersubm.getImageLoadStatus());
        System.out.println(torpesubm.getImageLoadStatus());
        System.out.println(gameover.getImageLoadStatus());
        System.out.println(sea.getImageLoadStatus());
    }
}
